/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 爬虫控制面板 */
.crawler-controls {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.crawler-controls h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.crawler-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.crawler-btn {
    position: relative;
    padding: 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 500;
}

.crawler-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.crawler-btn:active {
    transform: translateY(0);
}

.crawler-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.crawler-btn.running {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    animation: pulse 2s infinite;
}

.crawler-btn.test {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
}

.btn-icon {
    font-size: 1.5rem;
}

.btn-text {
    font-weight: 600;
}

.btn-shortcut {
    font-size: 0.8rem;
    opacity: 0.8;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

.control-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.start-index {
    display: flex;
    align-items: center;
    gap: 10px;
}

.start-index label {
    font-weight: 600;
    color: #333;
}

.start-index input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    width: 80px;
}

.stop-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.stop-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 爬虫状态面板 */
.crawler-status {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.crawler-status h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.status-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #ddd;
    transition: all 0.3s ease;
}

.status-card.running {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.status-card.error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.crawler-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

.status-indicator {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-indicator.idle {
    background: #e9ecef;
    color: #6c757d;
}

.status-indicator.running {
    background: #28a745;
    color: white;
    animation: pulse 2s infinite;
}

.status-indicator.error {
    background: #dc3545;
    color: white;
}

.status-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-item .label {
    font-weight: 500;
    color: #666;
}

.status-item .value {
    font-weight: 600;
    color: #333;
}

/* 日志面板 */
.logs-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.logs-header h2 {
    color: #333;
    font-size: 1.5rem;
}

.logs-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.log-tabs {
    display: flex;
    gap: 5px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
}

.log-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.log-tab.active {
    background: #667eea;
    color: white;
}

.log-tab:hover:not(.active) {
    background: #e9ecef;
}

.log-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #e9ecef;
}

.auto-scroll-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.auto-scroll-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.logs-container {
    position: relative;
    height: 400px;
}

.log-panel {
    display: none;
    height: 100%;
}

.log-panel.active {
    display: block;
}

.log-content {
    height: 100%;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #333333;
}

.log-entry {
    margin-bottom: 5px;
    padding: 2px 0;
    border-bottom: 1px solid #f0f0f0;
}

.log-timestamp {
    color: #666666;
    margin-right: 8px;
    font-weight: bold;
}

.log-message {
    color: #333333;
}

.log-message.error {
    color: #dc3545;
    font-weight: bold;
}

.log-message.warning {
    color: #ffc107;
    font-weight: bold;
}

.log-message.success {
    color: #28a745;
    font-weight: bold;
}

/* 结果查看器 */
.results-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h2 {
    color: #333;
    font-size: 1.5rem;
}

.results-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#resultType {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.results-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-item .label {
    font-weight: 500;
    color: #666;
}

.info-item .value {
    font-weight: 600;
    color: #333;
}

.viewer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.nav-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.author-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#currentAuthor {
    font-weight: 600;
    color: #333;
}

#authorIndex {
    font-size: 0.9rem;
    color: #666;
}

.author-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
}

.card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    gap: 10px;
}

.placeholder-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.placeholder-text {
    font-size: 1.1rem;
}

/* 通知样式 */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-left: 4px solid #667eea;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.notification.success {
    border-left-color: #28a745;
}

.notification.error {
    border-left-color: #dc3545;
}

.notification.warning {
    border-left-color: #ffc107;
}

/* 动画 */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .crawler-buttons {
        grid-template-columns: 1fr;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
    
    .logs-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .logs-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .log-tabs {
        justify-content: center;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .results-controls {
        justify-content: center;
    }
    
    .viewer-controls {
        flex-direction: column;
        gap: 10px;
    }
} 